<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<!--{include file='comm/header.tpl'}-->
	<title><!--{if $datas->itemID != null }--><!--{$itemCategoryName}-->编辑<!--{else}--><!--{$itemCategoryName}-->添加<!--{/if}--></title>
</head>

<script>
	$(document).ready(function(){
		$("#itemName").focus();
	})
	function saveCategoryBtn(){
		var error = '';
		var focus_obj = '';
		var itemName = $.trim($("#itemName").val());
		if(itemName == ""){
			error += "名称不能为空<br/>";
			focus_obj = "#itemName";
		}
		
		var sortorder = $.trim($("#sortorder").val());
		if(!digitalCheck(sortorder)){
			error += "排序必须为数字<br/>";
			if(focus_obj == '')
				focus_obj = "#sortorder";
		}
		
		if(error != ""){
			comm_alert(error,0,'',focus_obj);
			error = "";
			return false;
		}
		<!--{if $datas->itemID != null}-->
			xajax_startEdit(xajax.getFormValues("itemCategoryFrom"),3);
		<!--{else}-->
			xajax_startEdit(xajax.getFormValues("itemCategoryFrom"),2);
		<!--{/if}-->
	}

</script>
<!--{php}-->
	global $xajax;
	$xajax->printJavascript( "/framework/xajax" );
<!--{/php}-->
<body>
	<div style="width:100%">
		<!--{include file='comm/menu.tpl'}-->
		<div id="body_content" align="center" >
			<table class="comm_header_table" style="width:50%;">
				<tr>
					<td style="height:50px;text-align:center;" >
						<h1><!--{if $datas->itemID != null}--><!--{$itemCategoryName}-->_编辑<!--{else}--><!--{$itemCategoryName}-->_添加<!--{/if}--></h1>
					</td>
				</tr>
			</table>
			<form name = "itemCategoryFrom" id="itemCategoryFrom" method="post" onsubmit="return false;">
				<table style="width:50%;" class="comm_edit_table_1">
					<!--{if $datas->itemID != null}-->
					<tr style="height:30px;">
						<td style="width:10%;text-align:right;" class="td_title">编号：</td>
						<td style="width:40%;text-align:left;">
							<!--{$datas->itemID}-->
							<input type="hidden" value="<!--{$datas->itemID}-->" id="itemID" name="itemID" size="30"/>
							<input type="hidden" value="<!--{$itemCategoryName}-->" id="itemCategoryName" name="itemCategoryName" size="30"/>			 
						</td>
					</tr>
					<!--{/if}-->
					<tr style="height:30px;">
						<td style="width:10%;text-align:right;" class="td_title">名称：</td>
						<td style="width:40%;text-align:left;">
							<input type="text"  id="itemName" name="itemName" autocomplete="off" size="40" maxlength="50" value="<!--{$datas->itemName}-->"/>
							<font color="#FF0000"> *</font>					 
						</td>
					</tr>
					<tr style="height:30px;">
						<td style="text-align:right;" class="td_title">排序：</td>
						<td style="text-align:left;">
							<input type="text" id="sortorder" name="sortorder" autocomplete="off" size="10" maxlength="10" value="<!--{$datas->sortorder}-->">	
							<input type="hidden" value="<!--{$itemCategoryID}-->" id="itemCategoryID" name="itemCategoryID" size="30"/>		
							<font color="#FF0000"> *</font>	
						</td>
					</tr>
					<tr>
						<td style="text-align:right;" class="td_title">使用标志：</td>
						<td style="text-align:left;" height="30px">
							<!--{if $datas->useFlg === null}-->
								<input type="radio" name="useFlg" id="useFlg" value="1" checked>启用
								<input type="radio" name="useFlg" id="useFlg" value="0">禁用		
							<!--{else}-->
								<!--{if $datas->useFlg == 1}-->
									<input type="radio" name="useFlg" id="useFlg" value="1" checked>启用
									<input type="radio" name="useFlg" id="useFlg" value="0">禁用	
								<!--{else}-->
									<input type="radio" name="useFlg" id="useFlg" value="1">启用
									<input type="radio" name="useFlg" id="useFlg" value="0" checked>禁用	
								<!--{/if}-->
							<!--{/if}-->		
						</td>
					</tr>
			  </table>

			  <div style="height:30px;padding-top:8px;">
				<input type="button" value="保存" style="margin-right:20px;" class="saveCancelBtn" onclick="saveCategoryBtn()">
				<input type="button" value="关闭"  class="saveCancelBtn" id="doBack" name="doBack" onclick="doCloseWindows()">	
			 </div>
		</form>
		</div>
		<!--{include file='comm/footer.tpl'}-->
	</div>
</body>
</html>